<ul class="row list-unstyled">
  <% @course_rooms.each do |room| %>
    <li class="col-sm-10">
      <span class="col-sm-3">所属分店: <%= room.studio.try :name %></span>&nbsp;&nbsp;
      <span class="col-sm-3">教室名称: <%= room.room_name %></span>&nbsp;&nbsp;
      <span class="col-sm-5">教室位置: <%= room.location %></span>&nbsp;&nbsp;
      <span class="col-sm-2">人数上限: <%= room.max_contain %></span>&nbsp;&nbsp;
      <%= link_to '删除','javascript:void(0)',
        onclick: "ajax_function('/admin/company_configurations/destroy_configuration', 'course_room', 'CourseRoomConfiguration', #{room.id})",
        id: "delete_course_room#{room.id}" %>
    </li>
  <% end %>

  <%= form_for(@course_room, url: create_course_room_admin_company_configurations_path, html: { multipart: true}) do |f| %>
    <table>
      <tr>
        <td><%= f.select :studio_id, options_for_select(@current_studios.map{|u| [u.name, u.id]}), prompt: "所属分店" %></td>
        <td><%= f.text_field :room_name, required: true, placeholder: "教室名称", style: "width:10em" %></td>
        <td><%= f.text_field :location, required: true, placeholder: "教室位置", style: "width:10em" %></td>
        <td><%= f.number_field :max_contain, required: true, placeholder: "人数上限", style: "width:10em" %></td>
      </tr>
      <tr>
        <td colspan='2'>
          <%= f.submit "添加" %>
        </td>
      </tr>
    </table>
  <% end %>
</ul>
